﻿<!DOCTYPE html>
<html>

<head id="Head1" runat="server">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>问题上报看板</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <link rel="Shortcut Icon" href="../images/aecc.ico" type="image/x-icon" />
  <link rel="stylesheet" href="../StaticFiles/layui/dist/css/layui.css" />
  <link rel="stylesheet" href="../StaticFiles/layui/admin.css" />
  <link rel="stylesheet" href="../styles/pace.css" />
  <script type="text/javascript" src="../Scripts/pace.min.js"></script>
  <script type="text/javascript" src="../Scripts/json2.js"></script>
  <script type="text/javascript" src="../Scripts/jquery-1.11.2.min.js"></script>
  <style type="text/css">
    html {
      background-image: url(../images/bg.jpg);
      background-repeat: no-repeat;
    }

    .layui-card {
      background-color: transparent;
      border: 1px dashed #1E9FFF;
    }

    .layui-card-header {
      color: #fff;
      border: none;
      text-align: center;
      font-size: 20px;
      font-weight: bold;
      letter-spacing: 0.1em;
    }

    /*左上图片*/
    .bg-left-top {
      position: absolute;
      left: -2px;
      top: -2px;
      width: 25px;
      height: 25px;
      background-image: url(../images/left-top.png);
    }

    /*左下图片*/
    .bg-left-bottom {
      position: absolute;
      left: -2px;
      bottom: -2px;
      width: 25px;
      height: 25px;
      background-image: url(../images/left-bottom.png);
    }

    /*右上图片*/
    .bg-right-top {
      position: absolute;
      right: -2px;
      top: -2px;
      width: 25px;
      height: 25px;
      background-image: url(../images/right-top.png);
    }

    /*右下图片*/
    .bg-right-bottom {
      position: absolute;
      bottom: -2px;
      right: -2px;
      width: 25px;
      height: 25px;
      background-image: url(../images/right-bottom.png);
    }

    .layui-table-view th {
      font-weight: bold;
      font-size: 16px;
      text-align: center;
      color: #009688;
    }

    .layui-layer-title {
      text-align: center;
      font-weight: bold;
      font-size: 18px !important;
      color: #009688 !important;
    }
  </style>
</head>

<body>
  <!--[if lt IE 9]>
        <script src="../Scripts/pollyfills/es5-shim.min.js"></script>
        <script src="../Scripts/pollyfills/es5-sham.min.js"></script>
        <script src="../Scripts/pollyfills/html5.js"></script>
        <script src="../Scripts/pollyfills/response.js"></script>
    <![endif]-->
  <div class="layui-row" style="padding: 10px 15px;">
    <div class="layui-col-md3">
      <div>
        <img src="../images/aeec_logo.png" alt="" height="60" />
      </div>
    </div>
    <div class="layui-col-md6" style="height: 60px; line-height: 60px; text-align: center;
            font-size: 40px; letter-spacing: 0.1em; color: #fff;">
      装配厂问题上报看板
    </div>
    <div class="layui-col-md3" style="height: 60px; line-height: 60px; text-align: right;
            font-size: 16px; font-weight: bold; color: #fff;" id="currentTime">
    </div>
  </div>
  <div class="layui-fluid" style="padding-bottom: 0px;">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md8">
        <div class="layui-card">
          <div class="layui-card-header">
            <div class="bg-left-top">
            </div>
            <div class="bg-right-top">
            </div>
            <img src="../images/本月.png" height="26" alt="" />
            本月问题回复
          </div>
          <div class="layui-card-body">
            <div class="layui-row">
              <div class="layui-col-md3">
                <div class="layui-card" style="border:none;">
                  <div class="layui-card-header">
                    <img src="../images/答复.png" height="24" alt="" /> 问题回复率
                  </div>
                  <div class="layui-card-body">
                    <div id="HFL" style="height:180px;">
                    </div>
                  </div>
                </div>
              </div>
              <div class="layui-col-md3">
                <div class="layui-card" style="border:none;">
                  <div class="layui-card-header">
                    <img src="../images/答复.png" height="24" alt="" /> 当天回复率
                  </div>
                  <div class="layui-card-body">
                    <div id="YTHFL" style="height:180px;">
                    </div>
                  </div>
                </div>
              </div>
              <div class="layui-col-md3">
                <div class="layui-card" style="border:none;">
                  <div class="layui-card-header">
                    <img src="../images/超期.png" height="24" alt="" /> 问题超期率
                  </div>
                  <div class="layui-card-body">
                    <div id="CQL" style="height:180px;">
                    </div>
                  </div>
                </div>
              </div>
              <div class="layui-col-md3">
                <div class="layui-card" style="border:none;">
                  <div class="layui-card-header">
                    <img src="../images/关闭.png" height="30" alt="" /> 问题关闭率
                  </div>
                  <div class="layui-card-body">
                    <div id="GBL" style="height:180px;">
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="bg-left-bottom">
            </div>
            <div class="bg-right-bottom">
            </div>
          </div>
        </div>
      </div>
      <div class="layui-col-md4">
        <div class="layui-card">
          <div class="layui-card-header">
            <div class="bg-left-top">
            </div>
            <div class="bg-right-top">
            </div>
            <img src="../images/问题总数.png" height="30" alt="" />
            问题上报总数
          </div>
          <div class="layui-card-body">
            <div id="wtsbzs" style="height: 242px;">
            </div>
            <div class="bg-left-bottom">
            </div>
            <div class="bg-right-bottom">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="layui-fluid" style="padding-bottom: 0px;">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">
            <div class="bg-left-top">
            </div>
            <div class="bg-right-top">
            </div>
            <img src="../images/责任人.png" height="30" alt="" />
            责任单位回复情况
          </div>
          <div class="layui-card-body">
            <div id="zrdw" style="height: 250px;">
            </div>
            <div class="bg-left-bottom">
            </div>
            <div class="bg-right-bottom">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="layui-fluid" style="padding-bottom: 0px;">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">
            <div class="bg-left-top">
            </div>
            <div class="bg-right-top">
            </div>
            <img src="../images/提出问题.png" height="30" alt="" />
            提出单位回复情况
          </div>
          <div class="layui-card-body">
            <div id="tcdw" style="height: 250px;">
            </div>
            <div class="bg-left-bottom">
            </div>
            <div class="bg-right-bottom">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <script src="../Scripts/echarts/echarts-5.4.0.min.js"></script>
  <script type="text/javascript" src="../StaticFiles/layui/dist/layui.js"></script>
  <script type="text/javascript">
    $(function () {
      $(".layui-card:last-child").css({ "marginBottom": "0px" });
      function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数
        if (r != null) return unescape(r[2]); return null; //返回参数值
      };
      var $factoryid = getUrlParam('factoryid');

      // 页面右上方时钟
      function showTime() {
        var currentTime = new Date();
        var year = currentTime.getFullYear();
        var month = currentTime.getMonth() + 1;
        var date = currentTime.getDate();
        var day = currentTime.getDay();
        var hours = currentTime.getHours();
        var minutes = currentTime.getMinutes();
        var seconds = currentTime.getSeconds();
        var time = document.getElementById("currentTime");
        if (seconds < 10) {
          seconds = "0" + seconds;
        }
        if (minutes < 10) {
          minutes = "0" + minutes;
        }
        time.innerHTML = year + "年" + month + "月" + date + "日   " + hours + " : " + minutes + " : " + seconds;
      };
      setInterval(showTime, 500);

      layui.use(['layer', 'table'], function () {
        var table = layui.table;
        var layer = layui.layer;

        //弹出层通用方法
        function openDialog(config) {
          layer.open({
            title: config.title,
            type: 1,
            content: "<table class='layui-hide' id='test'></table>",
            area: ['100%', '100%'],
            skin: 'layui-layer-rim',
            success: function (layero) {
              table.render({
                elem: '#test',
                url: config.url,
                method: config.method,
                cols: config.cols,
                where: config.QueryString,
                request: {
                  pageName: 'page', //页码的参数名称，默认：page
                  limitName: 'rows' //每页数据量的参数名，默认：limit
                },
                cellMinWidth: 80,
                page: {
                  theme: '#1E9FFF'
                },
                text: {
                  none: '暂无相关数据' //默认：无数据。注：该属性为 layui 2.2.5 开始新增
                }
              });
            }
          });
        };

        var pieOption = {
          title: {
            text: '',
            left: "50%",
            textAlign: 'center',
            x: 'center',
            y: '75%',
            textStyle: {
              fontWeight: 'bold',
              fontSize: '16',
              color: '#fff',
              textAlign: 'center'
            }
          },
          series: {
            name: '',
            type: 'pie',
            clockWise: true,
            radius: [40, 55],
            itemStyle: {
              normal: {
                shadowBlur: 0,
                label: {
                  show: false
                },
                labelLine: {
                  show: false
                }
              }
            },
            hoverAnimation: false,
            center: ['50%', '40%'],
            data: [{
              value: [80],
              name: '完成',
              label: {
                normal: {
                  formatter: "{d}%",
                  position: 'center',
                  show: true,
                  textStyle: {
                    color: '#fff',
                    fontSize: '18',
                    fontWeight: 'bold'
                  }
                }
              },
              itemStyle: {
                normal: {
                  color: "#009688"
                }
              }
            }, {
              value: [20],
              name: '未完成',
              itemStyle: {
                normal: {
                  color: "#FFFFFF"
                }
              }
            }]
          }
        };

        //本月问题回复比率
        function GetFanJianWanChengQingKuang() {
          $.ajax({
            type: "GET",
            url: "../handler/board/ZSProblemLookBoard.ashx?type=GetZSThisMonthProblemRate",
            dataType: "text",
            cashe: false,
            data: {
              factoryid: $factoryid
            },
            beforeSend: function () {
            },
            success: function (result) {
              var data = JSON.parse(result);

              var HFLChart = echarts.init(document.getElementById('HFL'));
              var YTHFLChart = echarts.init(document.getElementById('YTHFL'));
              var CQLChart = echarts.init(document.getElementById('CQL'));
              var GBLChart = echarts.init(document.getElementById('GBL'));

              var HFLPieOption = pieOption;
              HFLPieOption.title.text = "总数：" + data[0].total + "条\n完成：" + data[0].finished + "条";
              HFLPieOption.series.name = "问题回复率";
              HFLPieOption.series.data[0].value = data[0].finished;
              HFLPieOption.series.data[1].value = data[0].notFinished;
              HFLChart.setOption(HFLPieOption);

              var YTHFLPieOption = pieOption;
              YTHFLPieOption.title.text = "总数：" + data[1].total + "条\n完成：" + data[1].finished + "条";
              YTHFLPieOption.series.name = "一天回复率";
              YTHFLPieOption.series.data[0].value = data[1].finished;
              YTHFLPieOption.series.data[1].value = data[1].notFinished;
              YTHFLChart.setOption(YTHFLPieOption);

              var CQLPieOption = pieOption;
              CQLPieOption.title.text = "总数：" + data[2].total + "条\n完成：" + data[2].finished + "条";
              CQLPieOption.series.name = "问题超期率";
              CQLPieOption.series.data[0].value = data[2].finished;
              CQLPieOption.series.data[1].value = data[2].notFinished;
              CQLChart.setOption(CQLPieOption);

              var GBLPieOption = pieOption;
              GBLPieOption.title.text = "总数：" + data[3].total + "条\n完成：" + data[3].finished + "条";
              GBLPieOption.series.name = "问题关闭率";
              GBLPieOption.series.data[0].value = data[3].finished;
              GBLPieOption.series.data[1].value = data[3].notFinished;
              GBLChart.setOption(GBLPieOption);
            }
          });

        };
        GetFanJianWanChengQingKuang();

        //问题上报总数
        function GetZSProblemTotalCountData() {
          $.ajax({
            type: "GET",
            url: "../handler/board/ZSProblemLookBoard.ashx?type=GetZSProblemTotalCountData",
            dataType: "text",
            cashe: false,
            data: {
              factoryid: $factoryid
            },
            beforeSend: function () {
              echarts.dispose(document.getElementById("wtsbzs"));
              var wtsbzs = echarts.init(document.getElementById('wtsbzs'));
              wtsbzs.showLoading({
                text: '数据查询中...',
                effect: 'whirling',
                maskColor: 'transparent',
                textColor: '#ffffff'
              });
            },
            success: function (data) {
              var obj = JSON.parse(data);

              var arrTotal = [], arrHuiFu = [], arrGuanBi = [], arrChaoQi = [];

              for (var i = 0; i < obj.length; i++) {
                arrTotal.push(obj[i]["total"]);
                arrHuiFu.push(obj[i]["huifu"]);
                arrGuanBi.push(obj[i]["guanbi"]);
                arrChaoQi.push(obj[i]["chaoqi"]);
              };

              echarts.dispose(document.getElementById("wtsbzs"));
              var chart = echarts.init(document.getElementById('wtsbzs'));
              chart.hideLoading();

              var option = {
                tooltip: {
                  trigger: 'axis',
                  show: true,
                  axisPointer: {
                    type: 'shadow'
                  }
                },
                grid: {
                  left: '3%',
                  right: '3%',
                  bottom: '15%',
                  containLabel: true
                },
                legend: {
                  data: ['问题总数', '回复总数', '关闭总数', '超期总数'],
                  x: 'center',
                  y: '220',
                  textStyle: {
                    fontSize: '12',
                    fontWeight: 'bold',
                    color: '#fff'
                  }
                },
                color: ['#00bfff', '#00ff00', '#C5C5C5', 'red'],
                xAxis: [{
                  type: 'category',
                  data: [],
                  axisTick: {
                    alignWithLabel: true
                  },
                  axisLine: {
                    lineStyle: {
                      color: '#fff',
                      width: '1'
                    }
                  },
                  axisLabel: {
                    show: true,
                    textStyle: {
                      color: '#fff',
                      fontSize: '12',
                      fontWeight: 'bold'
                    }
                  }
                }],
                yAxis: [{
                  type: 'value',
                  axisLine: {
                    lineStyle: {
                      color: '#fff',
                      width: '1'
                    }
                  },
                  axisLabel: {
                    show: true,
                    textStyle: {
                      color: '#fff',
                      fontSize: '12',
                      fontWeight: 'bold'
                    }
                  },
                  splitLine: {
                    show: false,
                    lineStyle: {
                      color: '#999',
                      type: 'dashed'
                    }
                  }
                }],
                series: [{
                  name: '问题总数',
                  type: 'bar',
                  barMaxWidth: 35,
                  data: arrTotal,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        //distance: 20,
                        fontSize: '12',
                        fontWeight: 'bold'
                        //rotate:90
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }, {
                  name: '回复总数',
                  type: 'bar',
                  barMaxWidth: 35,
                  data: arrHuiFu,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }, {
                  name: '关闭总数',
                  type: 'bar',
                  barMaxWidth: 35,
                  data: arrGuanBi,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }, {
                  name: '超期总数',
                  type: 'bar',
                  barMaxWidth: 35,
                  data: arrChaoQi,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }]
              };
              chart.setOption(option);

              chart.on('click', function (params) {
                if (params.seriesName === "问题总数") {
                  var config = {};
                  config.QueryString = { factoryid: $factoryid, type: "GetTotalProblemDataDetails", cwc: "All", rwc: "All" };
                  config.url = "../handler/board/ZSProblemLookBoard.ashx";
                  config.title = params.seriesName + "--明细";
                  config.method = 'post';
                  config.cols = [[
                    { type: 'numbers' },
                    { field: 'DESCRIPTION', title: '问题描述' },
                    { field: 'WORKCENTERNAME', title: '责任单位' },
                    { field: 'FULLNAME', title: '责任人' },
                    {
                      field: 'UFCCHULIDATE', title: '要求完成日期',
                      templet: function (d) {
                        if (d.UFCCHULIDATE === null) {
                          return "";
                        } else {
                          return d.UFCCHULIDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'CREATEPERSON', title: '提出人' },
                    {
                      field: 'UFCCREATEDATE', title: '提出时间',
                      templet: function (d) {
                        if (d.UFCCREATEDATE === null) {
                          return "";
                        } else {
                          return d.UFCCREATEDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'UFCRESULT', title: '处理意见' },
                    { field: 'PRIORITY', title: '需求程度' },
                    { field: 'DELAYDAY', title: '超期天数' }
                  ]];
                  openDialog(config);
                };
                if (params.seriesName === "超期总数") {
                  var config = {};
                  config.QueryString = { factoryid: $factoryid, type: "GetTotalChaoQiDetails", cwc: "All", rwc: "All" };
                  config.url = "../handler/board/ZSProblemLookBoard.ashx";
                  config.title = params.seriesName + "--明细";
                  config.method = 'post';
                  config.cols = [[
                    { type: 'numbers' },
                    { field: 'DESCRIPTION', title: '问题描述' },
                    { field: 'WORKCENTERNAME', title: '责任单位' },
                    { field: 'FULLNAME', title: '责任人' },
                    {
                      field: 'UFCCHULIDATE', title: '要求完成日期',
                      templet: function (d) {
                        if (d.UFCCHULIDATE === null) {
                          return "";
                        } else {
                          return d.UFCCHULIDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'CREATEPERSON', title: '提出人' },
                    {
                      field: 'UFCCREATEDATE', title: '提出时间',
                      templet: function (d) {
                        if (d.UFCCREATEDATE === null) {
                          return "";
                        } else {
                          return d.UFCCREATEDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'UFCRESULT', title: '处理意见' },
                    { field: 'DELAYDAY', title: '超期天数' }
                  ]];
                  openDialog(config);
                };
                if (params.seriesName === "回复总数") {
                  var config = {};
                  config.QueryString = { factoryid: $factoryid, type: "GetHuiFuDetails", cwc: "All", rwc: "All" };
                  config.url = "../handler/board/ZSProblemLookBoard.ashx";
                  config.title = params.seriesName + "--明细";
                  config.method = "post";
                  config.cols = [[
                    { type: 'numbers' },
                    { field: 'DESCRIPTION', title: '问题描述' },
                    { field: 'WORKCENTERNAME', title: '责任单位' },
                    { field: 'FULLNAME', title: '责任人' },
                    {
                      field: 'UFCCHULIDATE', title: '要求完成日期',
                      templet: function (d) {
                        if (d.UFCCHULIDATE === null) {
                          return "";
                        } else {
                          return d.UFCCHULIDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'CREATEPERSON', title: '提出人' },
                    {
                      field: 'UFCCREATEDATE', title: '提出时间',
                      templet: function (d) {
                        if (d.UFCCREATEDATE === null) {
                          return "";
                        } else {
                          return d.UFCCREATEDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'UFCRESULT', title: '处理意见' },
                    { field: 'DELAYDAY', title: '超期天数' }
                  ]];
                  openDialog(config);
                };
                if (params.seriesName === "关闭总数") {
                  var config = {};
                  config.QueryString = { factoryid: $factoryid, type: "GetGuanBiDetails", cwc: "All", rwc: "All" };
                  config.url = "../handler/board/ZSProblemLookBoard.ashx";
                  config.title = params.seriesName + "--明细";
                  config.method = "post";
                  config.cols = [[
                    { type: 'numbers' },
                    { field: 'DESCRIPTION', title: '问题描述' },
                    { field: 'WORKCENTERNAME', title: '责任单位' },
                    { field: 'FULLNAME', title: '责任人' },
                    {
                      field: 'UFCCHULIDATE', title: '要求完成日期',
                      templet: function (d) {
                        if (d.UFCCHULIDATE === null) {
                          return "";
                        } else {
                          return d.UFCCHULIDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'CREATEPERSON', title: '提出人' },
                    {
                      field: 'UFCCREATEDATE', title: '提出时间',
                      templet: function (d) {
                        if (d.UFCCREATEDATE === null) {
                          return "";
                        } else {
                          return d.UFCCREATEDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'UFCRESULT', title: '处理意见' },
                    { field: 'DELAYDAY', title: '超期天数' }
                  ]];
                  openDialog(config);
                };
              });
            }
          });
        };
        GetZSProblemTotalCountData();

        //责任单位问题回复情况
        function GetRespWorkcenterProblemData() {
          $.ajax({
            type: "GET",
            url: "../handler/board/ZSProblemLookBoard.ashx?type=GetRespWorkcenterProblemData",
            dataType: "text",
            cashe: false,
            data: {
              factoryid: $factoryid
            },
            beforeSend: function () {
              echarts.dispose(document.getElementById("zrdw"));
              var zrdw = echarts.init(document.getElementById('zrdw'));
              zrdw.showLoading({
                text: '数据查询中...',
                effect: 'whirling',
                maskColor: 'transparent',
                textColor: '#ffffff'
              });
            },
            success: function (data) {
              var obj = JSON.parse(data);

              var arrWorkcenter = [];
              var arrTotal = [];
              var arrHuiFu = [];
              var arrWanCheng = [];
              var arrGuanBi = [];
              var arrChaoQi = [];

              for (var i = 0; i < obj.length; i++) {
                if (obj[i]["WORKCENTERNAME"].indexOf("装试") != -1) {
                  arrWorkcenter.push(obj[i]["WORKCENTERNAME"].replace("装试", ""));
                } else {
                  arrWorkcenter.push(obj[i]["WORKCENTERNAME"]);
                };

                arrTotal.push(obj[i]["total"]);
                arrHuiFu.push(obj[i]["huifu"]);
                arrWanCheng.push(obj[i]["wancheng"]);
                arrGuanBi.push(obj[i]["guanbi"]);
                arrChaoQi.push(obj[i]["chaoqi"]);
              };

              echarts.dispose(document.getElementById("zrdw"));
              var chart = echarts.init(document.getElementById('zrdw'));
              chart.hideLoading();

              var option = {
                tooltip: {
                  trigger: 'axis',
                  show: false,
                  axisPointer: {
                    type: 'shadow'
                  }
                },
                grid: {
                  left: '1%',
                  right: '1%',
                  bottom: '3%',
                  containLabel: true
                },
                legend: {
                  data: ['总问题', '已回复', '已超期'],
                  x: '10',
                  y: '10',
                  textStyle: {
                    fontSize: '12',
                    fontWeight: 'bold',
                    color: '#fff'
                  }
                },
                color: ['#00BFFF', '#32CD32', 'red'],
                xAxis: [{
                  type: 'category',
                  axisTick: {
                    alignWithLabel: true
                  },
                  axisLine: {
                    lineStyle: {
                      color: '#fff',
                      width: '1'
                    }
                  },
                  axisLabel: {
                    show: true,
                    textStyle: {
                      color: '#fff',
                      fontSize: '12',
                      fontWeight: 'bold'
                    }
                  },
                  //data: ['装试技术质量处', '装试试车中心', '装试第一装配中心', '装试综合管理处', '装试生产保障处', '装试第二装配中心']
                  data: arrWorkcenter
                }],
                yAxis: [{
                  type: 'value',
                  axisLine: {
                    lineStyle: {
                      color: '#fff',
                      width: '1'
                    }
                  },
                  axisLabel: {
                    show: true,
                    textStyle: {
                      color: '#fff',
                      fontSize: '12',
                      fontWeight: 'bold'
                    }
                  },
                  splitLine: {
                    show: false,
                    lineStyle: {
                      color: '#999',
                      type: 'dashed'
                    }
                  }
                }],
                series: [{
                  name: '总问题',
                  type: 'bar',
                  barMaxWidth: 30,
                  //data: [10, 6, 2, 6, 8, 12],
                  data: arrTotal,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }, {
                  name: '已回复',
                  type: 'bar',
                  barMaxWidth: 30,
                  //data: [5, 3, 5, 6, 3, 1],
                  data: arrHuiFu,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }, {
                  name: '已超期',
                  type: 'bar',
                  barMaxWidth: 30,
                  //data: [2, 0, 1, 4, 6, 2],
                  data: arrChaoQi,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }]
              };
              chart.setOption(option);

              chart.on('click', function (params) {
                if (params.seriesName === "总问题") {
                  var config = {};
                  config.QueryString = { factoryid: $factoryid, type: "GetTotalProblemDataDetails", cwc: "All", rwc: params.name };
                  config.url = "../handler/board/ZSProblemLookBoard.ashx";
                  config.title = "责任单位回复情况" + "--" + params.name + "--" + params.seriesName + "--明细";
                  config.method = "post";
                  config.cols = [[
                    { type: 'numbers' },
                    { field: 'DESCRIPTION', title: '问题描述' },
                    { field: 'WORKCENTERNAME', title: '责任单位' },
                    { field: 'FULLNAME', title: '责任人' },
                    {
                      field: 'UFCCHULIDATE', title: '要求完成日期',
                      templet: function (d) {
                        if (d.UFCCHULIDATE === null) {
                          return "";
                        } else {
                          return d.UFCCHULIDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'CREATEPERSON', title: '提出人' },
                    {
                      field: 'UFCCREATEDATE', title: '提出时间',
                      templet: function (d) {
                        if (d.UFCCREATEDATE === null) {
                          return "";
                        } else {
                          return d.UFCCREATEDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'UFCRESULT', title: '处理意见' },
                    { field: 'PRIORITY', title: '需求程度' },
                    { field: 'DELAYDAY', title: '超期天数' }
                  ]];
                  openDialog(config);
                };
                if (params.seriesName === "已回复") {
                  var config = {};
                  config.QueryString = { factoryid: $factoryid, type: "GetHuiFuDetails", cwc: "All", rwc: params.name };
                  config.url = "../handler/board/ZSProblemLookBoard.ashx";
                  config.title = "责任单位回复情况" + "--" + params.name + "--" + params.seriesName + "--明细";
                  config.method = "post";
                  config.cols = [[
                    { type: 'numbers' },
                    { field: 'DESCRIPTION', title: '问题描述' },
                    { field: 'WORKCENTERNAME', title: '责任单位' },
                    { field: 'FULLNAME', title: '责任人' },
                    {
                      field: 'UFCCHULIDATE', title: '要求完成日期',
                      templet: function (d) {
                        if (d.UFCCHULIDATE === null) {
                          return "";
                        } else {
                          return d.UFCCHULIDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'CREATEPERSON', title: '提出人' },
                    {
                      field: 'UFCCREATEDATE', title: '提出时间',
                      templet: function (d) {
                        if (d.UFCCREATEDATE === null) {
                          return "";
                        } else {
                          return d.UFCCREATEDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'UFCRESULT', title: '处理意见' },
                    { field: 'DELAYDAY', title: '超期天数' }
                  ]];
                  openDialog(config);
                };
                if (params.seriesName === "已超期") {
                  var config = {};
                  config.QueryString = { factoryid: $factoryid, type: "GetTotalChaoQiDetails", cwc: "All", rwc: params.name };
                  config.url = "../handler/board/ZSProblemLookBoard.ashx";
                  config.title = "责任单位回复情况" + "--" + params.name + "--" + params.seriesName + "--明细";
                  config.method = "post";
                  config.cols = [[
                    { type: 'numbers' },
                    { field: 'DESCRIPTION', title: '问题描述' },
                    { field: 'WORKCENTERNAME', title: '责任单位' },
                    { field: 'FULLNAME', title: '责任人' },
                    {
                      field: 'UFCCHULIDATE', title: '要求完成日期',
                      templet: function (d) {
                        if (d.UFCCHULIDATE === null) {
                          return "";
                        } else {
                          return d.UFCCHULIDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'CREATEPERSON', title: '提出人' },
                    {
                      field: 'UFCCREATEDATE', title: '提出时间',
                      templet: function (d) {
                        if (d.UFCCREATEDATE === null) {
                          return "";
                        } else {
                          return d.UFCCREATEDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'UFCRESULT', title: '处理意见' },
                    { field: 'DELAYDAY', title: '超期天数' }
                  ]];
                  openDialog(config);
                };
              });
            }
          });
        };
        GetRespWorkcenterProblemData();

        //提出单位问题回复情况
        function GetCreateWorkcenterProblemData() {
          $.ajax({
            type: "GET",
            url: "../handler/board/ZSProblemLookBoard.ashx?type=GetZSCreateWorkcenterProblemData",
            dataType: "text",
            cashe: false,
            data: {
              factoryid: $factoryid
            },
            beforeSend: function () {
              echarts.dispose(document.getElementById("tcdw"));
              var tcdw = echarts.init(document.getElementById('tcdw'));
              tcdw.showLoading({
                text: '数据查询中...',
                effect: 'whirling',
                maskColor: 'transparent',
                textColor: '#ffffff'
              });
            },
            success: function (data) {
              var obj = JSON.parse(data);

              var arrWorkcenter = [];
              var arrTotal = [];
              var arrHuiFu = [];
              var arrWanCheng = [];
              var arrGuanBi = [];
              var arrChaoQi = [];

              for (var i = 0; i < obj.length; i++) {
                if (obj[i]["WORKCENTERNAME"].indexOf("装试") != -1) {
                  arrWorkcenter.push(obj[i]["WORKCENTERNAME"].replace("装试", ""));
                } else {
                  arrWorkcenter.push(obj[i]["WORKCENTERNAME"]);
                };

                arrTotal.push(obj[i]["total"]);
                arrHuiFu.push(obj[i]["huifu"]);
                arrWanCheng.push(obj[i]["wancheng"]);
                arrGuanBi.push(obj[i]["guanbi"]);
                arrChaoQi.push(obj[i]["chaoqi"]);
              }

              echarts.dispose(document.getElementById("tcdw"));
              var chart = echarts.init(document.getElementById('tcdw'));
              chart.hideLoading();

              var option = {
                tooltip: {
                  trigger: 'axis',
                  show: false,
                  axisPointer: {
                    type: 'shadow'
                  }
                },
                grid: {
                  left: '1%',
                  right: '1%',
                  bottom: '3%',
                  containLabel: true
                },
                legend: {
                  data: ['总问题', '已回复', '已超期'],
                  x: '10',
                  y: '10',
                  textStyle: {
                    fontSize: '12',
                    fontWeight: 'bold',
                    color: '#fff'
                  }
                },
                color: ['#00BFFF', '#32CD32', 'red'],
                xAxis: [{
                  type: 'category',
                  axisTick: {
                    alignWithLabel: true
                  },
                  axisLine: {
                    lineStyle: {
                      color: '#fff',
                      width: '1'
                    }
                  },
                  axisLabel: {
                    show: true,
                    textStyle: {
                      color: '#fff',
                      fontSize: '12',
                      fontWeight: 'bold'
                    }
                  },
                  data: arrWorkcenter
                }],
                yAxis: [{
                  type: 'value',
                  axisLine: {
                    lineStyle: {
                      color: '#fff',
                      width: '1'
                    }
                  },
                  axisLabel: {
                    show: true,

                    textStyle: {
                      color: '#fff',
                      fontSize: '12',
                      fontWeight: 'bold'
                    }
                  },
                  splitLine: {
                    show: false,
                    lineStyle: {
                      color: '#999',
                      type: 'dashed'
                    }
                  }
                }],
                series: [{
                  name: '总问题',
                  type: 'bar',
                  barMaxWidth: 30,
                  data: arrTotal,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }, {
                  name: '已回复',
                  type: 'bar',
                  barMaxWidth: 30,
                  data: arrHuiFu,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }, {
                  name: '已超期',
                  type: 'bar',
                  barMaxWidth: 30,
                  data: arrChaoQi,
                  itemStyle: {
                    normal: {
                      label: {
                        show: true,
                        position: 'top',
                        fontSize: '12',
                        fontWeight: 'bold'
                      },
                      barBorderRadius: [5, 5, 0, 0]
                    }
                  }
                }]
              };
              chart.setOption(option);

              chart.on('click', function (params) {
                if (params.seriesName === "总问题") {
                  var config = {};
                  config.QueryString = { factoryid: $factoryid, type: "GetTotalProblemDataDetails", rwc: "All", cwc: params.name };
                  config.url = "../handler/board/ZSProblemLookBoard.ashx";
                  config.title = "提出单位回复情况" + "--" + params.name + "--" + params.seriesName + "--明细";
                  config.method = "post";
                  config.cols = [[
                    { type: 'numbers' },
                    { field: 'DESCRIPTION', title: '问题描述' },
                    { field: 'WORKCENTERNAME', title: '责任单位' },
                    { field: 'FULLNAME', title: '责任人' },
                    {
                      field: 'UFCCHULIDATE', title: '要求完成日期',
                      templet: function (d) {
                        if (d.UFCCHULIDATE === null) {
                          return "";
                        } else {
                          return d.UFCCHULIDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'CREATEPERSON', title: '提出人' },
                    {
                      field: 'UFCCREATEDATE', title: '提出时间',
                      templet: function (d) {
                        if (d.UFCCREATEDATE === null) {
                          return "";
                        } else {
                          return d.UFCCREATEDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'UFCRESULT', title: '处理意见' },
                    { field: 'PRIORITY', title: '需求程度' },
                    { field: 'DELAYDAY', title: '超期天数' }
                  ]];
                  openDialog(config);
                };
                if (params.seriesName === "已回复") {
                  var config = {};
                  config.QueryString = { factoryid: $factoryid, type: "GetHuiFuDetails", rwc: "All", cwc: params.name };
                  config.url = "../handler/board/ZSProblemLookBoard.ashx";
                  config.title = "提出单位回复情况" + "--" + params.name + "--" + params.seriesName + "--明细";
                  config.method = "post";
                  config.cols = [[
                    { type: 'numbers' },
                    { field: 'DESCRIPTION', title: '问题描述' },
                    { field: 'WORKCENTERNAME', title: '责任单位' },
                    { field: 'FULLNAME', title: '责任人' },
                    {
                      field: 'UFCCHULIDATE', title: '要求完成日期',
                      templet: function (d) {
                        if (d.UFCCHULIDATE === null) {
                          return "";
                        } else {
                          return d.UFCCHULIDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'CREATEPERSON', title: '提出人' },
                    {
                      field: 'UFCCREATEDATE', title: '提出时间',
                      templet: function (d) {
                        if (d.UFCCREATEDATE === null) {
                          return "";
                        } else {
                          return d.UFCCREATEDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'UFCRESULT', title: '处理意见' },
                    { field: 'DELAYDAY', title: '超期天数' }
                  ]];
                  openDialog(config);
                };
                if (params.seriesName === "已超期") {
                  var config = {};
                  config.QueryString = { factoryid: $factoryid, type: "GetTotalChaoQiDetails", rwc: "All", cwc: params.name };
                  config.url = "../handler/board/ZSProblemLookBoard.ashx";
                  config.title = "提出单位回复情况" + "--" + params.name + "--" + params.seriesName + "--明细";
                  config.method = "post";
                  config.cols = [[
                    { type: 'numbers' },
                    { field: 'DESCRIPTION', title: '问题描述' },
                    { field: 'WORKCENTERNAME', title: '责任单位' },
                    { field: 'FULLNAME', title: '责任人' },
                    {
                      field: 'UFCCHULIDATE', title: '要求完成日期',
                      templet: function (d) {
                        if (d.UFCCHULIDATE === null) {
                          return "";
                        } else {
                          return d.UFCCHULIDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'CREATEPERSON', title: '提出人' },
                    {
                      field: 'UFCCREATEDATE', title: '提出时间',
                      templet: function (d) {
                        if (d.UFCCREATEDATE === null) {
                          return "";
                        } else {
                          return d.UFCCREATEDATE.split('T')[0];
                        }
                      }
                    },
                    { field: 'UFCRESULT', title: '处理意见' },
                    { field: 'DELAYDAY', title: '超期天数' }
                  ]];
                  openDialog(config);
                };
              });
            }
          });
        };
        GetCreateWorkcenterProblemData();

      });

    });
  </script>
</body>

</html>